home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / JLabelBeanInfo.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  5.7 KB  |  62 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Image;
  4. import java.beans.BeanDescriptor;
  5. import java.beans.PropertyDescriptor;
  6. import java.beans.SimpleBeanInfo;
  7. import javax.swing.beaninfo.SwingBeanInfo;
  8.  
  9. public class JLabelBeanInfo extends SwingBeanInfo {
  10.    private static final Class classJLabel;
  11.    // $FF: synthetic field
  12.    static Class class$javax$swing$JLabel;
  13.  
  14.    static {
  15.       classJLabel = class$javax$swing$JLabel != null ? class$javax$swing$JLabel : (class$javax$swing$JLabel = class$("javax.swing.JLabel"));
  16.    }
  17.  
  18.    // $FF: synthetic method
  19.    static Class class$(String var0) {
  20.       try {
  21.          return Class.forName(var0);
  22.       } catch (ClassNotFoundException var2) {
  23.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  24.       }
  25.    }
  26.  
  27.    private PropertyDescriptor createPropertyDescriptor(String var1, Object[] var2) {
  28.       return super.createPropertyDescriptor(classJLabel, var1, var2);
  29.    }
  30.  
  31.    public BeanDescriptor getBeanDescriptor() {
  32.       return ((SwingBeanInfo)this).createBeanDescriptor(classJLabel, new Object[]{"preferred", Boolean.TRUE, "isContainer", Boolean.FALSE, "shortDescription", "A component that displays a short string and an icon."});
  33.    }
  34.  
  35.    public Image getIcon(int var1) {
  36.       switch (var1) {
  37.          case 1:
  38.             Image var5 = ((SimpleBeanInfo)this).loadImage("beaninfo/images/JLabelColor16.gif");
  39.             return var5 == null ? ((SimpleBeanInfo)this).loadImage("beaninfo/images/JComponentColor16.gif") : var5;
  40.          case 2:
  41.             Image var4 = ((SimpleBeanInfo)this).loadImage("beaninfo/images/JLabelColor32.gif");
  42.             return var4 == null ? ((SimpleBeanInfo)this).loadImage("beaninfo/images/JComponentColor32.gif") : var4;
  43.          case 3:
  44.             Image var3 = ((SimpleBeanInfo)this).loadImage("beaninfo/images/JLabelMono16.gif");
  45.             return var3 == null ? ((SimpleBeanInfo)this).loadImage("beaninfo/images/JComponentMono16.gif") : var3;
  46.          case 4:
  47.             Image var2 = ((SimpleBeanInfo)this).loadImage("beaninfo/images/JLabelMono32.gif");
  48.             return var2 == null ? ((SimpleBeanInfo)this).loadImage("beaninfo/images/JComponentMono32.gif") : var2;
  49.          default:
  50.             return super.getIcon(var1);
  51.       }
  52.    }
  53.  
  54.    public PropertyDescriptor[] getPropertyDescriptors() {
  55.       Object[] var1 = new Object[]{"LEFT", new Integer(2), "SwingConstants.LEFT", "CENTER", new Integer(0), "SwingConstants.CENTER", "RIGHT", new Integer(4), "SwingConstants.RIGHT", "LEADING", new Integer(10), "SwingConstants.LEADING", "TRAILING", new Integer(11), "SwingConstants.TRAILING"};
  56.       Object[] var2 = new Object[]{"TOP", new Integer(1), "SwingConstants.TOP", "CENTER", new Integer(0), "SwingConstants.CENTER", "BOTTOM", new Integer(3), "SwingConstants.BOTTOM"};
  57.       Object[] var3 = new Object[]{"LEFT", new Integer(2), "SwingConstants.LEFT", "CENTER", new Integer(0), "SwingConstants.CENTER", "RIGHT", new Integer(4), "SwingConstants.RIGHT", "LEADING", new Integer(10), "SwingConstants.LEADING", "TRAILING", new Integer(11), "SwingConstants.TRAILING"};
  58.       Object[] var4 = new Object[]{"TOP", new Integer(1), "SwingConstants.TOP", "CENTER", new Integer(0), "SwingConstants.CENTER", "BOTTOM", new Integer(3), "SwingConstants.BOTTOM"};
  59.       return new PropertyDescriptor[]{this.createPropertyDescriptor("icon", new Object[]{"bound", Boolean.TRUE, "preferred", Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "The icon this component will display."}), this.createPropertyDescriptor("horizontalTextPosition", new Object[]{"bound", Boolean.TRUE, "enumerationValues", var1, "expert", Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "The horizontal position of the label's text, relative to its image."}), this.createPropertyDescriptor("UIClassID", new Object[]{"shortDescription", "UIClassID"}), this.createPropertyDescriptor("accessibleContext", new Object[]{"bound", Boolean.FALSE, "expert", Boolean.TRUE, "shortDescription", "The AccessibleContext associated with this Label."}), this.createPropertyDescriptor("UI", new Object[]{"bound", Boolean.FALSE, "expert", Boolean.TRUE, "shortDescription", "The L&F object that renders this component."}), this.createPropertyDescriptor("disabledIcon", new Object[]{"bound", Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "The icon to display if the label is disabled."}), this.createPropertyDescriptor("verticalTextPosition", new Object[]{"bound", Boolean.TRUE, "enumerationValues", var2, "expert", Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "The vertical position of the text relative to it's image."}), this.createPropertyDescriptor("text", new Object[]{"bound", Boolean.TRUE, "preferred", Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "Defines the single line of text this component will display."}), this.createPropertyDescriptor("iconTextGap", new Object[]{"bound", Boolean.TRUE, "visualUpdate", Boolean.TRUE, "shortDescription", "If both the icon and text properties are set, this property defines the space between them."}), this.createPropertyDescriptor("labelFor", new Object[]{"bound", Boolean.TRUE, "shortDescription", "The component this is labelling."}), this.createPropertyDescriptor("horizontalAlignment", new Object[]{"bound", Boolean.TRUE, "enumerationValues", var3, "visualUpdate", Boolean.TRUE, "shortDescription", "The alignment of the label's content along the X axis."}), this.createPropertyDescriptor("verticalAlignment", new Object[]{"bound", Boolean.TRUE, "enumerationValues", var4, "visualUpdate", Boolean.TRUE, "shortDescription", "The alignment of the label's contents along the Y axis."})};
  60.    }
  61. }
  62.